
package com.kgajowy.ast;

import edu.pjwstk.jps.ast.IExpression;
import edu.pjwstk.jps.visitor.ASTVisitor;

public class Tree implements IExpression {

    private Tree parent;

    private Tree left;
    private Tree right;

    public Tree() {
        this.setRoot(null);
    }

    public Tree(Tree parent) {
        this.setRoot(parent);
    }

    public Tree getRoot() {
        return parent;
    }

    public void setRoot(Tree parent) {
        this.parent = parent;
    }

    public void addLeafs(Tree left, Tree right) {
        this.setLeft(left);
        this.setRight(right);
    }

    public void AddLeftLeaf(Tree left) {
        this.setLeft(left);
    }

    public void addRightLeaf(Tree right) {
        this.setRight(right);
    }

    public Tree getLeft() {
        return left;
    }

    public void setLeft(Tree left) {
        this.left = left;
    }

    public Tree getRight() {
        return right;
    }

    public void setRight(Tree right) {
        this.right = right;
    }

    @Override
    public void accept(ASTVisitor visitor) {
    }

    public void print(String sep) {
    };

}
